package com.maxlen.coupon.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.maxlen.common.constant.CouponConstant;
import com.maxlen.coupon.entity.CouponHistoryEntity;
import com.maxlen.coupon.entity.vo.CouponTagVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 优惠券领取历史记录
 *
 * @author MaxLen
 * @email MaxLen@gmail.com
 * @date 2022-10-27 10:43:47
 */
@Mapper
public interface CouponHistoryDao extends BaseMapper<CouponHistoryEntity> {

    int lockCoupon(@Param("couponHistoryId") Long couponHistoryId,
                   @Param("orderSn") String orderSn,
                   @Param("date") Date date,
                   @Param("noUse") Integer noUse,
                   @Param("use") Integer use);

    List<CouponTagVO> getCouponInfo(@Param("memberId") Long memberId, @Param("noUse") Integer noUse);
}
